<template>
<div>
  <el-card class="box-card">
    <el-form label-width="80px" style="text-align: left" inline>
    <div style="text-align: left">
      <el-form-item label="线路名称" prop="lineName">
        <el-input v-model="line.lineName" class="buycla"></el-input>
      </el-form-item>
    </div>
    <div style="text-align: left">
      <el-form-item label="出游天数" prop="days">
        <el-input v-model="line.days" class="buycla"></el-input>
      </el-form-item>
      <el-form-item label="团购价格" prop="price">
        <el-input v-model="line.price" class="buycla"></el-input>
      </el-form-item>
    </div>
    <div>
      <el-form-item label="开团时间" prop="price">
        <el-date-picker v-model="line.beginTime" type="datetime"
                        format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
                        placeholder="选择日期时间" style="width: 290px">

        </el-date-picker >
      </el-form-item >
      <el-form-item label="闭团时间" prop="price">
        <el-date-picker v-model="line.endTime" type="datetime" placeholder="选择日期时间" style="width: 290px"></el-date-picker>
      </el-form-item>

    </div>
    <div style="text-align: left ">
      <el-form-item label="出游工具" prop="vehicle">
        <el-select v-model="line.vehicle" placeholder="请选择" style="width: 290px">
          <el-option v-for="(item,index) in options" :key="index"
                     :label="item.label"
                     :value="item.label" >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="线路类型" prop="lineTypeID">
        <el-select v-model="line.typeName" placeholder="请选择" style="width: 290px;">
          <el-option
              v-for="(item,index) in type"
              :key="index"
              :label="item.name"
              :value="item.name">
          </el-option>
        </el-select>
      </el-form-item>
    </div>
    <div style="text-align: left">
      <el-form-item label="推荐理由" prop="arrange">
        <el-input type="textarea" v-model="line.reason" class="buycla"></el-input>
      </el-form-item>
      <el-form-item label="行程安排" prop="arrange">
        <el-input type="textarea" v-model="line.arrange" class="buycla"></el-input>
      </el-form-item>
      <el-form-item label="线路简介" prop="introduction">
        <el-input type="textarea" v-model="line.introduction" class="buycla"></el-input>
      </el-form-item>
    </div>
    <div>
      <el-button type="primary" plain @click="putBuy">确定设置</el-button>
      <el-button type="primary" plain @click="$router.push('/adminGroupbuy')">取消设置</el-button>
    </div>
  </el-form>
  </el-card>
</div>
</template>

<script>
export default {
  name: "adminPutBuy",
  data(){
    return{
      // putLine:{},
      lineType:{},
      // line:,
      line:this.$route.query.lineInfo,
      options: [
        {label: '飞机'}, {label: '游轮'}, {label: '大巴'}, {label: '汽车'}, {label: '高铁'}],
      type:[{name:'境内游'},{name:'境外游'},{name:'海岛游'}],
    }
  },
  created() {
    // this.line.teamBuyPrice=this.line.price;
  },
  methods:{
    putBuy:function (){
      this.line.teamBuy=1;
      console.log(this.line)
      this.$axios.put("/api/admin/Groupbuy", this.line).then(res => {
        this.$message.warning(res.data.msg);
        this.$router.push("/adminGroupbuy");
      })
    }
  }
}
</script>

<style>
.el-input__inner{

  padding: 0 5px;
}
.el-form-item__content{
  width: 290px;
}

.el-textarea{
  width: 290px;
}
.el-textarea__inner{
  padding: 0 5px;
}
.buycla{
  width: 290px;
  height: 30px;
  line-height: 30px;
}
</style>